
import { INCREMENT, DECREMENT } from './constant'

export function increment(value) {
    return { type: INCREMENT, data: value }
}
export function decrement(value) {
    return { type: DECREMENT, data: value }
}
// 异步 action 一般调用同步 action
export function incrementAsync(value,time){
    return (dispatch)=>{
        setTimeout(() => {
           dispatch(increment(value*1))
        }, time)
    }
}